/*
 * @FilePath: \undefinedc:\Users\sxjct\.leetcode\217.存在重复元素.cpp
 * @Brief: 
 * @Version: 1.0
 * @Date: 2021-04-08 16:12:32
 * @Author: tianyiyi
 * @Copyright: Copyright@tianyiyi
 * @LastEditors: Mr.Tian
 * @LastEditTime: 2021-04-08 16:15:07
 */
/*
 * @lc app=leetcode.cn id=217 lang=cpp
 *
 * [217] 存在重复元素
 */

// @lc code=start
class Solution {
public:
    bool containsDuplicate(vector<int>& nums) {
        unordered_map<int,int> map;
        for(int i = 0;i < nums.size();i++)
        {
            if(map[nums[i]] > 0)
            {
                return true;
            }
            map[nums[i]]++;
        }
        return false;
    }
};
// @lc code=end

